﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Markup;

namespace StoryMaker.Application
{
    public class EnumExtension : MarkupExtension
    {
        public EnumExtension(Type enumType, string enumValue)
        {
            this._enumType = enumType;
            this._enumValue = enumValue;
        }

        private Type _enumType;
        private string _enumValue;
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return Enum.Parse(_enumType, _enumValue);
        }
    }
}
